<?php
namespace app\zhonghang\controller;
use think\Controller;
use think\Request;
use think\Db;
use think\Session;
use think\Cache;
use think\Lang;
use think\Cookie;

require_once (APP_PATH . 'api/RewardApi.php');
class Member extends Controller {
    public function _initialize(){
        parent::_initialize();
       
    }
    /**
     * 新闻中心
     */
    public function index()
    {
        $zifuji=Cookie::get('think_var');
        $chanpin =  DB::name('Goods_category')->where('parent_id',0)->where('is_show',1)->limit('1')->find();
        $erweima = DB::name('Website')->where('w_logo_status',1)->find();
        if($zifuji=='zh-cn'){
            $list = DB::name('team_type')->select();
        }elseif($zifuji=='en-us'){
            $list = DB::name('team_type_us')->select();
        }else{
            $list = DB::name('team_type_jp')->select();
        }
        $lists = DB::name('Website')->find();
        $lisst = Lang::get('dbcp');
        $xwzxtp=DB::name('Config')->where('name','xwzxtp')->value('value');
        $this->assign('xwzxtp',$xwzxtp);
        $this->assign('lisst',$lisst);
        $this->assign('lists',$lists);
        $this->assign('list',$list);
        $this->assign('erweima',$erweima);
        $this->assign('chanpin',$chanpin);
        return $this->fetch('new/news');
    }
    public function details()
    {
        $zifuji=Cookie::get('think_var');
        $chanpin =  DB::name('Goods_category')->where('parent_id',0)->where('is_show',1)->limit('1')->find();
        $erweima = DB::name('Website')->where('w_logo_status',1)->find();
        $id = input('id');
        if($zifuji=='zh-cn'){
            $list = DB::name('team_type')->where('id',$id)->find();
            $list['c_content']=htmlspecialchars_decode($list['c_content']);
        }elseif($zifuji=='en-us'){
            $list = DB::name('team_type_us')->where('id',$id)->find();
            $list['c_content']=htmlspecialchars_decode($list['c_content']);
        }else{
            $list = DB::name('team_type_jp')->where('id',$id)->find();
            $list['c_content']=htmlspecialchars_decode($list['c_content']);
        }
//        $xx = DB::name('tongyong')->where('parent_id',0)->select();
        $lists = DB::name('Website')->find();
        $lisst = Lang::get('dbcp');
        $xwzxtp=DB::name('Config')->where('name','xwzxtp')->value('value');
        $this->assign('xwzxtp',$xwzxtp);
        $this->assign('lisst',$lisst);
        $this->assign('lists',$lists);
        $this->assign('list',$list);
        $this->assign('erweima',$erweima);
        $this->assign('chanpin',$chanpin);
        return $this->fetch('new/newx-xx');
    }
//    招标
    public function zhao()
    {
        $zifuji=Cookie::get('think_var');
        $chanpin =  DB::name('Goods_category')->where('parent_id',0)->where('is_show',1)->limit('1')->find();
        $erweima = DB::name('Website')->where('w_logo_status',1)->find();
        if($zifuji=='zh-cn'){
            $list = DB::name('team_type_copy')->select();
        }elseif($zifuji=='en-us'){
            $list = DB::name('team_type_copy_us')->select();
        }else{
            $list = DB::name('team_type_copy_jp')->select();
        }

        $lists = DB::name('Website')->find();
        $lisst = Lang::get('dbcp');
        $xwzxtp=DB::name('Config')->where('name','xwzxtp')->value('value');
        $this->assign('xwzxtp',$xwzxtp);
        $this->assign('lisst',$lisst);
        $this->assign('lists',$lists);
        $this->assign('list',$list);
        $this->assign('erweima',$erweima);
        $this->assign('chanpin',$chanpin);
        return $this->fetch('new/zhao');
    }
    public function detailszhao()
    {
        $zifuji=Cookie::get('think_var');
        $chanpin =  DB::name('Goods_category')->where('parent_id',0)->where('is_show',1)->limit('1')->find();
        $erweima = DB::name('Website')->where('w_logo_status',1)->find();
        $id = input('id');
        if($zifuji=='zh-cn'){
            $list = DB::name('team_type_copy')->where('id',$id)->find();
            $list['c_content']=htmlspecialchars_decode($list['c_content']);
        }elseif($zifuji=='en-us'){
            $list = DB::name('team_type_copy_us')->where('id',$id)->find();
            $list['c_content']=htmlspecialchars_decode($list['c_content']);
        }else{
            $list = DB::name('team_type_copy_jp')->where('id',$id)->find();
            $list['c_content']=htmlspecialchars_decode($list['c_content']);
        }
        $xwzxtp=DB::name('Config')->where('name','xwzxtp')->value('value');
        $this->assign('xwzxtp',$xwzxtp);
        $lists = DB::name('Website')->find();
        $lisst = Lang::get('dbcp');
        $this->assign('lisst',$lisst);
        $this->assign('lists',$lists);
        $this->assign('list',$list);
        $this->assign('erweima',$erweima);
        $this->assign('chanpin',$chanpin);
        return $this->fetch('new/zhao-xx');
    }
}